package com.quanxi.qxaimain;

import com.baomidou.dynamic.datasource.DynamicDataSourceCreator;
import com.quanxi.qxaimain.common.globalException.GlobalException;

/**
 * @Author lyx
 * @create 2022/9/2 14:28
 */
public class BankDemo
{
    public static void main(String [] args)
    {


        CheckingAccount c = new CheckingAccount(101);
        System.out.println("Depositing $500...");
        c.deposit(500.00); //方法：存钱
        try
        {
            System.out.println("\nWithdrawing $100...");
            c.withdraw(100.00); //方法：取钱
            System.out.println("\nWithdrawing $600...");
            c.withdraw(600.00); //方法：取钱
        }catch(GlobalException e)
        {
            System.out.println("Sorry, but you are short $"
                    + e.getMsg());
             e.printStackTrace();
        }




    }
}